﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Security.Cryptography;
using System.Text;

namespace FichoWeb.Common
{
    public static class Encryption
    {
        public static string ToSHA(this string value)
        {
            if (value.Length < 1)
                return "";

            Byte[] bytes = Encoding.UTF8.GetBytes(value);
            HashAlgorithm hash = new SHA256CryptoServiceProvider();
            hash.ComputeHash(bytes);
            return BitConverter.ToString(hash.Hash);
        }
    }
}